package com.aptech.yuanhuabao.api.soap.result;

import com.aptech.yuanhuabao.api.soap.parser.SoapGenerator;
import com.jaydenxiao.common.commonutils.LogUtils;

import java.io.Serializable;

/**
 * des:
 * Created by zhh_li
 * on 2017/1/19.
 */

public abstract class BaseResult implements Serializable{
    private static final  String LOG_TAG = "BaseResult";

    public String result;// <result>SUCCESS</result>

    public String parserResult = "UNKNOWN"; // xml转义<>后得到内容


    public void setResult(String result) {
        this.result = result;
    }

    public String getResult() {

        return result;
    }

    public boolean isSucess() {

        return result.equals("SUCCESS") ? true : false;
    }


    public  String parserXmlStr(String xmlStr){
        String parserResult = SoapGenerator.htmlUnescape(xmlStr);
        LogUtils.logv(LOG_TAG, parserResult);
        return parserResult;
    }

    public String toString(){
        return parserResult;
    }
}
